package thread;

//线程状态
public class Demo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
           while (true) {
                for (int i = 0; i < 10; i++) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
           }
        });

        System.out.println(t1.getState());
        t1.start();

        for (int i = 0; i < 5; i++) {
            System.out.println(t1.getState());
            Thread.sleep(1000);
        }
        t1.join();

        System.out.println(t1.getState());
    }
}
//BLOCK 和 WAITING后面再说